package blockchain.mystream;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.Socket;

public class MySocket extends MySocketAbstract implements MyDataInputStreamInterface, MyDataOutputStreamInterface {
    public MySocket(Socket socket) throws IOException {
        super(socket);
    }
    public MySocket(String ip, int port) throws IOException {
        super(new Socket(ip, port));
    }

    @Override
    public DataInputStream getDataInputStream() {
        return in;
    }
    @Override
    public DataOutputStream getDataOutputStream() {
        return out;
    }

    @Override
    public void close() throws IOException {
        socket.close();
    }
}
